from django.contrib.gis.db import models
from django.db.models import Manager as GeoManager
# Create your models here.

class Trajectory(models.Model):
    # 用户昵称
    gid= models.AutoField(primary_key=True)
    taxiid = models.IntegerField(max_length=20, default='unknown')
    # 创建时间
    locatedtime = models.DateTimeField()
    longitude = models.FloatField(default=114.36146545410156)
    latitude = models.FloatField(default=30.52894401550293)
    direction = models.FloatField(default=0)
    speed = models.FloatField(default=-1)
    empty_load = models.CharField(max_length=20, default='重车')
    geom = models.PointField(srid=4326, geography=True,null=True)
    objects = GeoManager()

class userDriver(models.Model):
    # 用户昵称
    username=models.CharField(max_length=20, default='unknown')
    # 用户密码
    password = models.CharField(max_length=20, default='unknown')
    # 用户邮箱
    email= models.CharField(max_length=20, default='unknown')
    # 车主/管理员
    driverORadmin = models.CharField(max_length=20, default='unknown')

class userAdmin(models.Model):
    # 用户昵称
    username=models.CharField(max_length=20, default='unknown')
    # 用户密码
    password = models.CharField(max_length=20, default='unknown')
    # 用户邮箱
    email= models.CharField(max_length=20, default='unknown')
    # 车主/管理员
    driverORadmin = models.CharField(max_length=20, default='unknown')